﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RearLivestock.Common.Domains.hq;
using RearLivestock.Common.Dtos;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Bedroomss;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.Departmentss;
using RearLivestock.RBAC.Api.Application.hqApplication.Commands.PigFarmss;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;

namespace RearLivestock.RBAC.Api.Controllers.hq
{
    /// <summary>
    /// 猪场管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PigFarmController : ControllerBase
    {
        private readonly IMediator imediator;
       

        public PigFarmController(IMediator imediator)
        {
            this.imediator = imediator;
        }
        /// <summary>
        /// 猪场管理
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> addPigFarmrooms(AddFarmCommand command)
        {
            return await imediator.Send(command);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost]
        public async Task<Result<PageResultDto<Pigfarmas>>> showFarm(ShowFarmCommand cmd
            )
        {
            return await imediator.Send(cmd);
        }
    }
}
